from typing import List


class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        mapping = {}
        for i in range(len(nums)):
            if nums[i] in mapping:
                return [mapping[nums[i]], i]
            else:
                mapping[target - nums[i]] = i


if __name__ == "__main__":
    result = Solution().twoSum([0, 8, 1, 6], 9)
    print(result)
